﻿<%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     <script type="text/javascript" language="javascript">
         function OnClick(s, e) {
             grid.GetRowValues(grid.GetFocusedRowIndex(), 'TourgroupID', OnGetRowValues);
         }
         function OnGetRowValues(values) {
             pop_add.SetHeaderText('团基本信息及团行程安排信息');
             var url = 'Schedule.aspx?tid=' + values;
             pop_add.SetContentUrl(url);
             pop_add.Show();
          }
    </script>
    <h2>
        欢迎使用团信息查询!
    </h2>
    <table width="100%">
        <tr>
            <td >
                起始日期
            </td>
            <td >

                <dx:ASPxDateEdit ID="dateStart" runat="server" Width="100px">
                </dx:ASPxDateEdit>

            </td>
            <td >
                结束日期
            </td>
            <td>
                
                <dx:ASPxDateEdit ID="dateEnd" runat="server" Width="100px">
                </dx:ASPxDateEdit>
                
            </td>
            <td >
                团状态
            </td>
            <td>
                <dx:ASPxComboBox ID="comboStatus" runat="server" Width="100px" SelectedIndex="0"
                    ValueType="System.String">
                    <Items>
                        <dx:ListEditItem Selected="True" Text="全部" Value="全部" />
                        <dx:ListEditItem Selected="false" Text="计划" Value="计划" />
                        <dx:ListEditItem Selected="false" Text="成行" Value="成行" />
                        <dx:ListEditItem Selected="false" Text="审核" Value="审核" />
                        <dx:ListEditItem Selected="false" Text="终结" Value="终结" />
                        <dx:ListEditItem Selected="false" Text="取消" Value="取消" />
                        <dx:ListEditItem Selected="false" Text="删除" Value="删除" />
                    </Items>
                </dx:ASPxComboBox>
            </td>
            <td >
                团名称
            </td>
            <td>
                <dx:ASPxTextBox ID="tbToursName" runat="server" Width="100px">
                </dx:ASPxTextBox>
            </td>
            <td>
                <dx:ASPxButton ID="btnRefresh" runat="server" Text="刷新" 
                    PostBackUrl="~/Default.aspx?type=0" >
                </dx:ASPxButton>
            </td>
            <td >
                客人
            </td>
            <td>
                <dx:ASPxTextBox ID="guestSearch" runat="server" Width="100px">
                </dx:ASPxTextBox>
            </td>
            <td>
                <dx:ASPxButton ID="btnSearch" runat="server" Text="检索" PostBackUrl="~/Default.aspx?type=1">
                </dx:ASPxButton>
            </td>
        </tr>
        </table>
        <table width="100%">
        <tr>
            <td>
                <dx:ASPxGridView ID="teamGridView" runat="server" AutoGenerateColumns="False" 
                    Width="100%" OnHtmlRowPrepared="teamGridView_HtmlRowPrepared" 
                    ClientInstanceName="grid" KeyFieldName="TourgroupID">
                    
                    <ClientSideEvents RowDblClick="OnClick" />
                    
                    <TotalSummary>
                        <dx:ASPxSummaryItem FieldName="TourgroupID" SummaryType="Count" />
                        <dx:ASPxSummaryItem FieldName="AdultNum" SummaryType="Sum" />
                        <dx:ASPxSummaryItem FieldName="ChildNum" SummaryType="Sum" />
                        <dx:ASPxSummaryItem FieldName="StayOver" SummaryType="Sum" />
                        <dx:ASPxSummaryItem FieldName="CustomPersonNum" SummaryType="Sum" />
                    </TotalSummary>
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="计划号" FieldName="TourgroupID" ShowInCustomizationForm="True"
                            VisibleIndex="0" Width="70px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="团名" FieldName="TourgroupName" ShowInCustomizationForm="True"
                            VisibleIndex="1" Width="160px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="成人数" FieldName="AdultNum" ShowInCustomizationForm="True"
                            VisibleIndex="2" Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="儿童数" FieldName="ChildNum" ShowInCustomizationForm="True"
                            VisibleIndex="3" Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="起始时间" FieldName="StartDate" ShowInCustomizationForm="True"
                            VisibleIndex="4" Width="75px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="终止日期" FieldName="EndDate" ShowInCustomizationForm="True"
                            VisibleIndex="5" Width="75px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="团状态" FieldName="TourgroupState" ShowInCustomizationForm="True"
                            VisibleIndex="6" Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="组团人A" FieldName="OwnerA" ShowInCustomizationForm="True"
                            VisibleIndex="7" Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="组团人B" FieldName="OwnerB" ShowInCustomizationForm="True"
                            VisibleIndex="8" Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="人天" ShowInCustomizationForm="True" UnboundExpression="[StayOver] * [AdultNum]"
                            UnboundType="Integer" VisibleIndex="9" FieldName="CustomPersonNum" 
                            Width="35px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="组团日" FieldName="BuildGroupDate" VisibleIndex="10"
                            Width="75px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="客户名称" FieldName="CustomerName" VisibleIndex="11"
                            Width="170px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="国家代码" FieldName="CountryCode" VisibleIndex="12"
                            Width="70px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="团队类型" FieldName="Tourgrouptype" VisibleIndex="13"
                            Width="70px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="服务类型" FieldName="Servicetype" VisibleIndex="14"
                            Width="70px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="客人" FieldName="Guesttype" VisibleIndex="15" 
                            Width="50px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="过夜数" FieldName="StayOver" VisibleIndex="17" 
                            Width="40px">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    
                    <SettingsBehavior AllowFocusedRow="True" />
                    <SettingsPager PageSize="20">
                    </SettingsPager>
                    <Settings ShowFooter="True" ShowHorizontalScrollBar="True" />
                </dx:ASPxGridView>
            </td>
        </tr>
    </table>
    <p>
        <dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" AllowDragging="True" 
            ClientInstanceName="pop_add" Height="550px" 
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
            Width="1024px" AllowResize="True" DragElement="Window" Modal="True" 
            CloseAction="CloseButton">
        </dx:ASPxPopupControl>
        
    </p>
</asp:Content>
